import { TenantVO } from '@/api/system/tenant/types';
import { VxeGridProps } from 'vxe-table';

export function getTableConfig(): VxeGridProps<TenantVO> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',

    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id',
      height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { type: 'checkbox', width: 60 },
      { sortable: true, field: 'tenantId', title: '租户编号' },
      { sortable: true, field: 'contactUserName', title: '联系人' },
      { sortable: true, field: 'contactPhone', title: '联系电话' },
      { sortable: true, field: 'companyName', title: '企业名称' },
      { sortable: true, field: 'licenseNumber', title: '社会信用代码' },
      { sortable: true, field: 'expireTime', title: '过期时间' },
      { sortable: true, field: 'status', title: '租户状态', slots: { default: 'status' } },
      { sortable: true, field: 'handle', title: '操作', slots: { default: 'handle' } }
    ],
    data: [] as TenantVO[]
  };
}
